<template>
<view>
	<view class="item" v-for="(item, index) in list" :key="index">
        <view class="avatar"><image :src="item.avatar_url"></image></view>
        <view class="comment-info">
            <view class="nickname-like">
                <view class="nickname">{{item.nickname}}</view>
                <view class="like">
                    <u-icon @tap="commentLike(item.id, index)" :name="!item.is_like?'thumb-up':'thumb-up-fill'" :color="result.is_like?$config.color:'#aaaaaa'" size="24"></u-icon>
                    <view class="like-count">{{item.like_count}}</view>
                </view>
            </view>
            <navigator class="comment-desc" :url="'commentDetail?id=' + item.id" hover-class="none">{{item.content}}</navigator>
            <view class="date-reply">
                <navigator class="date" :url="'commentDetail?id=' + item.id" hover-class="none">{{item.create_time}}</navigator>
                <navigator class="reply" :url="'commentDetail?operate=reply' + '&id=' + item.id">回复TA</navigator>
            </view>
            <navigator class="reply-count" v-if="item.reply_count > 0" :url="'commentDetail?id=' + item.id" hover-class="none">
                全部{{item.reply_count}}条回复 >
            </navigator>
        </view>
    </view>
</view>
</template>

<script>
	export default {
	    data() {
			return {
                //在vue页面中的view模板中使用系统设置参数$config则需要在data()中定义一下变量: $config:[], 然后就可以在模板中正常使用了:{{$config.color}}
                $config: []
            }
        },
		props:{
			list: {
				type: Array,
				default(){
					return []
				}
			}
		}
	}
</script>

<style lang="scss">

</style>
